#include "abstract_pin.h"
#include "messages.h"

namespace arduino {

unsigned int abstract_pin::state() const
{
	return state_;
}

unsigned int abstract_pin::pin_number() const
{
	return pin_number_;
}

void abstract_pin::set_state(unsigned int state)
{
	pin_state_msg msg;

	msg.pin_number = pin_number_;
	msg.state = state;

	brd_->send(&msg, sizeof(msg));
	state_ = state;
}

} // namespace arduino